#ifndef __DBTREE_H__
#define __DBTREE_H__
#include <vector>
#include <iostream>
#include <string>
#include <ctime>
using namespace std;

namespace db
{

class Base;
class Tag;

class TreeVertex
{
  friend class Base;
  
  public:
    // Con- and destructor
    TreeVertex(int ID, TreeVertex* parent = NULL);
    ~TreeVertex();

    // User Methods
    /// Modyfing posts
    void setTitle(string title);
    void setText(string text);
    void setDate(time_t date);
    void addTag(string tag);
    void remTag(string tag);

    /// Getting information
    int getID();
    time_t getDate();
    string getTitle();
    string getText();
    int getBranchCount();
    int getTagsCount();
    string getTag(int id);

  private:
    // Properties	
    int ID;
    time_t Date;
    string Title;
    string Text;
    vector<Tag*> Tags;
    vector<TreeVertex*> Children;
    TreeVertex* Parent;
};

};

#endif /* __DBTREE_H__ */